<template>
  <div>
    <van-nav-bar title="支付成功" left-text="返回" @click-left="onClickLeft" left-arrow>
      <template #right>
        <van-icon name="search" size="18" />
      </template>
    </van-nav-bar>
    <div style="text-align:center;margin-top:80px">
      <van-icon name="checked" size="150px" color="#FF5165" />
      <br>
      <el-col :span="18" :offset="3">
        <van-button color="#FF5165" plain block @click="toIndex(0)">查看订单</van-button>
      </el-col>
      <el-col :span="18" :offset="3" style="margin-top:20px">
        <span style="font-size:14px;color:rgb(144, 144, 144);" @click="toIndex(1)">返回首页</span>
      </el-col>
    </div>
  </div>
</template>
<script>
import { Toast } from 'vant';
export default {
  data () {
    return {

    }
  },
  methods: {
    onClickLeft () {
      this.$router.go(-1);
    },
    toIndex (index) {
      if (index == 0) {
        Toast.loading({
          message: '正在加载...',
          forbidClick: true,
        });
        setTimeout(() => {
          Toast.clear();
          this.$router.push('/order')
        }, 500);

      } else {
        this.$router.push('/')
      }
    }
  }
}
</script>
<style scoped>
</style>